let a: number | string = 1;  // 声明类型,ts是js的超集
a = "2";  // 让 a 不花心？

const getUserInfos = (user:{name: string, age: number}) => {
    return `name: ${user.name} age: ${user.age}`
}
getUserInfos({name:'yang', age:18})